@extends('layouts.admin.admin_master')

@section('head')
  <meta name="csrf-token" content="{{ csrf_token() }}" />
  <link rel="stylesheet" type="text/css" href="{{ asset('admin/css/webuploader/webuploader.css') }}">
  <link rel="stylesheet" type="text/css" href="{{ asset('admin/css/webuploader/style.css') }}" />
@endsection
@section('content')
  <section class="content-header">
    <h1>
      商品管理
      <small>商品图片</small>
    </h1>
    <ol class="breadcrumb">
      <li><a href="#"><i class="fa fa-dashboard"></i> 商品管理</a></li>
      <li class="active">图片列表</li>
    </ol>
  </section>
  <div id="wrapper">
      <div id="container">
          <!--头部，相册选择和格式选择-->

          <div id="uploader">
              <div class="queueList">
                  <div id="dndArea" class="placeholder">
                      <div id="filePicker"></div>
                      <p>或将照片拖到这里，单次最多可选300张</p>
                  </div>
              </div>
              <div class="statusBar" style="display:none;">
                  <div class="progress">
                      <span class="text">0%</span>
                      <span class="percentage"></span>
                  </div><div class="info"></div>
                  <div class="btns">
                      <div id="filePicker2"></div><div class="uploadBtn">开始上传</div>
                  </div>
              </div>
          </div>
      </div>

      <div class="box">
        <div class="box-header">
          <h3 class="box-title">图片列表</h3>
        </div>
        <!-- /.box-header -->
        <div class="box-body table-responsive no-padding">
          <table class="table table-hover">
            <tr>
              <th>序号</th>
              <th>缩略图</th>
              <th>描述</th>
              <th colspan="2">操作</th>
            </tr>
          @if (!$photos->isEmpty())
          @foreach ($photos as $photo)
            <tr>
              <td>{{ $photo->photo_id }}</td>
              <td><img src="{{ $photo->photo_url }}" alt="{{ $photo->description }}"></td>
              <td>{{ $photo->created_at }}</td>
              <td><span class="label label-danger"><a href="">删除</a></span></td>
              <td><span class="label label-success"><a href="">设为封面</a></span></td>
            </tr>
          @endforeach
          @else
            <tr>
              <td colspan="4" align="center"><span class="label label-warning">暂无图片</span></td>
            </tr>
          @endif
          </table>
        </div>
        <!-- /.box-body -->
      </div>
      <!-- /.box -->
  </div>
@endsection

@section('required_script')
  <script type="text/javascript" src="{{ asset('admin/js/webuploader/webuploader.min.js') }}"></script>
  <script type="text/javascript" src="{{ asset('admin/js/webuploader/product_photos.js') }}"></script>
@endsection